
#include "NtCoreLib.h"

namespace NT
{
namespace Atom
{
	NtLong Inc(volatile NtLong& target)
	{
		return InterlockedIncrement(&target);
	}

	NtLong Dec(volatile NtLong& target)
	{
		return InterlockedDecrement(&target);
	}

	NtLong Add(volatile NtLong& target,NtLong val)
	{
		return InterlockedExchangeAdd(&target, val);
	}

	NtLong Sub(volatile NtLong& target,NtLong val)
	{
		return InterlockedExchangeAdd(&target, -val);
	}
}
}
